import java.util.ArrayList;

public class Block {
	enum blockType{Logic, Ethics, Passion, Deception};
	
	private blockType type;
	private int health;
	private int height;
	ArrayList<EffectActive> effects;
	
	public Block(blockType type){
		this.type=type;
		switch(type){
		case Logic:
			//logic hp 40 h 8 ethics hp 30 h 14 decep hp 30 h 20 passion hp 20 h 20
			health=40;
			height=8;
			break;
		case Ethics:
			health=30;
			height = 14;
			break;
		case Deception:
			health = 30;
			height = 20;
			break;
		case Passion:
			health= 20;
			height = 20;
			break;
			
		}
	}
	
	public Block(blockType type, int health, int height){
		this.type = type;
		this.health = health;
		this.height = height;
		effects = new ArrayList<EffectActive>();
	}
	
	public Block(blockType type, int health, int height, ArrayList<EffectActive> effects){
		this(type,health,height);
		this.effects = effects;
	}
	
	public int getHeight(){
		return height;
	}
	
	public void setType(int itype){
		switch (itype)
		{
			case(0): type= Block.blockType.Logic; break;
			case(1): type= Block.blockType.Ethics; break;
			case(2): type= Block.blockType.Passion; break;
			case(3): type= Block.blockType.Deception; break;
		}
	}
	
	public int getType()
	{
		switch (type)
		{
			case Logic: return 0; //Blue
			case Ethics: return 1; //Yellow
			case Passion: return 2; //Red
			case Deception: return 3; //Grey
			default: return 0;
		}
	}

	public void takeDamage(int damage){
		health -= damage;	
		if (health<=0) health=0;
	}
	
	public int getHealth()
	{
		return health;
	}
	
	public boolean isDead(){
		return (health <= 0);
	}
	
	public String toString()
	{
		String s = "Block: ";
		switch (type)
		{
			case Logic: s+= "Logic, ";break; //Blue
			case Ethics: s+= "Ethics, ";break; //Yellow
			case Passion: s+= "Passion, ";break; //Red
			case Deception: s+= "Deception, ";break; //Grey
		}
		s+= "Health: " + health + ", Height: " + height;
		return s;
	}

	public void setHealth(int i) {
		this.health = i;
		
	}

	public void setHeight(int magnitude) {
		this.height = magnitude;
		
	}
	
	
	
}
